<?php if ( ! defined('ABSPATH')) exit('restricted access');

global $_webnukes;

$module_settings = $_webnukes->get_settings('sub_insurance_companies');

if($_webnukes->kvalue($module_settings, 'status') == "active"):?>
<div class="container">
    <div id="insurance-companies">
		<h2><?php echo $_webnukes->kvalue($module_settings, 'title');?></h2>
        <a class="buttons prev" href="javascript:void(0);"></a>
		<a class="buttons next" href="javascript:void(0);"></a>
		
		<div class="viewport">
			<ul class="overview">
				<?php foreach((array)$_webnukes->kvalue($module_settings, 'DYNAMIC') as $insurance):?>
                    <?php if($_webnukes->kvalue($insurance, 'status') == 'active'):?>
                        <li>
                            <a href="<?php echo $_webnukes->kvalue($insurance, 'link', 'javascript:void(0);');?>" rel="nofollow" target="<?php echo $_webnukes->kvalue($insurance, 'target', '_blank');?>">
                                <img src="<?php echo $_webnukes->kvalue($insurance, 'image');?>" alt="<?php echo $_webnukes->kvalue($insurance, 'title');?>" />
                            </a>
                        </li>
                    <?php endif;?>
                <?php endforeach;?>
			</ul>
		</div>
	</div>
</div>

<script type="text/javascript">
jQuery(document).ready(function($){

	$('#insurance-companies ul.overview').carouFredSel({
		responsive: <?php echo $_webnukes->kvalue($module_settings, 'responsive', 'true'); ?>,
		width: '100%',
		scroll: <?php echo $_webnukes->kvalue($module_settings, 'scroll_item', 'true'); ?>,
		items: {
			visible: {
				min: <?php echo $_webnukes->kvalue($module_settings, 'display_min', 'true'); ?>,
				max: <?php echo $_webnukes->kvalue($module_settings, 'display_max', 'true'); ?>
			}},
		auto:<?php echo $_webnukes->kvalue($module_settings, 'interval', 'true'); ?>,
		circular:<?php echo $_webnukes->kvalue($module_settings, 'rewind', 'false'); ?>,
		mousewheel: <?php echo $_webnukes->kvalue($module_settings, 'mousewheel', 'true'); ?>,
		direction:'<?php echo $_webnukes->kvalue($module_settings, 'direction', 'true'); ?>',
		swipe: {
			onMouse: <?php echo $_webnukes->kvalue($module_settings, 'swipe_mouse', 'true'); ?>,
			onTouch: <?php echo $_webnukes->kvalue($module_settings, 'swipe_touch', 'true'); ?>
		},
		prev: '.prev',
		next: '.next'
	});		
});
</script>
<?php endif;?>